package com.music.note_android.data.model

import androidx.room.ColumnInfo

/**
 * 文件夹及其笔记数量的数据类
 * 用于Room查询时返回文件夹信息和对应的笔记数量
 */
data class FolderWithNoteCount(
    @ColumnInfo(name = "id")
    val id: String,
    
    @ColumnInfo(name = "name")
    val name: String,
    
    @ColumnInfo(name = "created_time")
    val createdTime: Long,
    
    @ColumnInfo(name = "is_system")
    val isSystem: Boolean,
    
    @ColumnInfo(name = "note_count")
    val noteCount: Int
) {
    /**
     * 转换为Folder对象
     */
    fun toFolder(): Folder {
        return Folder(
            id = id,
            name = name,
            createdTime = createdTime,
            isSystem = isSystem,
            noteCount = noteCount
        )
    }
}